import Vue from 'vue'
import VueRouter from 'vue-router'
import Router from 'vue-router'
// 导入刚才编写的组件
import Login from '../components/Login'
import Register from "../components/Register";
import student from "../components/student";
import STCourse from "../components/STCourse";
import TeacherSchoolMessage from "../components/TeacherSchoolMessage";
import Home from "../components/Home";
import Admin from '../components/views/admin'
import Information from '../components/views/information'
import Grade from '../components/views/grade'
import courseIndex from "../components/course/CourseIndex"
import CourseDetails from "../components/course/CourseDetails"
import CourseWork from "../components/course/CourseWork"
import WorkIndex from "../components/course/WorkIndex"
import CaseStudy from "../components/course/CaseStudy";
import Index from "../components/Index";
import addLesson from "../components/teacher/addLesson"
import addSession from "../components/teacher/addSession"
import addHomework from "../components/teacher/addHomework"
import playVideo  from "../components/playVideo";
import TeacherLesson from "../components/teacher/TeacherLesson";
import addSourse from "../components/teacher/addSourse";
import coumaneger from "../components/teacher/coumaneger";
import checkHomework from "../components/teacher/checkHomework";
import reportForm from "../components/teacher/reportForm";


const course = () => import('../views/course/index')
const hiscourse = () => import('../views/hiscourse/index.vue')
const Applycourse = () => import('../views/Applycourse/index.vue')


Vue.use(Router)
Vue.use(VueRouter)
export default new Router({
  mode:'history',
  routes: [
    // 下面都是固定的写法
    {path: '/', redirect: '/login'},
    {path: '/1', redirect: '/index'},
    {
      path:'/coumaneger',
      name: 'coumaneger',
      component:coumaneger,
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path:'/st_course',
      name:'STCourse',
      component: STCourse
    },
    {
      path: '/grade',
      name: 'grade',
      component: Grade,
    },
    {
      path: '/information',
      name: 'information',
      component: Information,
    },
    {
      path: '/admin',
      name: 'admin',
      component: Admin,
    },
    {
      path: '/Applycourse',
      name: 'Applycourse',
      component: Applycourse
    },
    {
      path: '/course2',
      name: 'course',
      component: course,


    },
    {
      path: '/hiscourse',
      name: 'hiscourse',
      component: hiscourse,
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect: '/index',
      children: [
        {
          path: '/Index',
          name: 'Index',
          component: Index,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/courseIndex',
          name: 'courseIndex',
          component: courseIndex,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/courseDetails',
          name: 'CourseDetails',
          component: CourseDetails,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/courseWork',
          name: 'CourseWork',
          component: CourseWork,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/workIndex',
          name: 'WorkIndex',
          component: WorkIndex,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/teacher_message',
          name: 'TeacherSchoolMessage',
          component: TeacherSchoolMessage,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/student',
          name: 'student',
          component: student,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/casestudy',
          name: 'CaseStudy',
          component: CaseStudy,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/teacher',
          name: 'addLesson',
          component: addLesson,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/addlesson',
          name: 'addLesson',
          component: addLesson,
          meta: {
            requireAuth: true
          }
        },{
          path: '/addsession',
          name: 'addSession',
          component: addSession,
          meta: {
            requireAuth: true
          }
        },{
          path: '/addHomework',
          name: 'addHomework',
          component: addHomework,
          meta: {
            requireAuth: true
          }
        },
        {
          path: '/playvideo',
          name: 'playVideo',
          component: playVideo,
          meta: {
            requireAuth: true
          },
        },{
          path: '/checkhomework',
          name: 'checkHomework',
          component: checkHomework,
          meta: {
            requireAuth: true
          },
        },
        {
          path: '/teacherlesson',
          name: 'TeacherLesson',
          component: TeacherLesson,
          meta: {
            requireAuth: true
          },
        },
        {
          path: '/addsourse',
          name: 'addSourse',
          component: addSourse,
          meta: {
            requireAuth: true
          },
        },
        {
          path: '/reportform',
          name: 'reportForm',
          component: reportForm,
          meta: {
            requireAuth: true
          },
        },

      ]
    }

  ]
})

